package com.umeox.watch.audiobooks.base

import android.content.Context
import android.content.Intent
import android.os.Build
import android.view.View
import androidx.multidex.MultiDexApplication
import com.umeox.watch.audiobooks.BuildConfig
import com.umeox.watch.audiobooks.R
import com.umeox.watch.audiobooks.utils.StoryManager
import com.umeox.watch.moto.dataservice.DataProvider
import com.yc.music.service.PlayService
import com.yc.music.tool.BaseAppHelper
import com.yc.music.utils.MusicLogUtils
import com.yc.music.utils.MusicSpUtils
import uk.co.chrisjenx.calligraphy.CalligraphyConfig

/**
 * Created by Rambo 2024/5/20/0020
 * Describe:
 */
class BaseApp : MultiDexApplication() {
    companion object {
        private var appContext: Context? = null
        fun getContext(): Context {
            return appContext as Context
        }
    }

    override fun onCreate() {
        super.onCreate()
        appContext = this
        MusicSpUtils.init(this)
        MusicLogUtils.setIsLog(BuildConfig.DEBUG)
        DataProvider.initialize(this)
        StoryManager.buildFavoriteList()
        CalligraphyConfig.initDefault(
            CalligraphyConfig.Builder()
                .setDefaultFontPath("fonts/Roboto-Medium.ttf")
                .setFontAttrId(R.attr.fontPath)
                .build()
        )
    }
}
